FROM golang:1.19

WORKDIR /usr/src/app

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN  sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \
     sed -i 's|security.debian.org|mirrors.163.com/debian-security|g' /etc/apt/sources.list && \
     apt-get clean && \
     apt-get update && \
     go env -w GOPROXY=https://goproxy.cn,direct && \
     apt-get -y install rsync

 CMD ["app"]